import type { App } from 'vue'
import { defineAsyncComponent } from 'vue'

export const setupGlobRevModules = (app: App<Element>): void => {
  app.component(
    'RevTable',
    defineAsyncComponent(() => import('./Table.vue'))
  )
  app.component(
    'RevForm',
    defineAsyncComponent(() => import('./Form.vue'))
  )
  app.component(
    'RevTableForm',
    defineAsyncComponent(() => import('./TableForm.vue'))
  )
  app.component(
    'RevRelations',
    defineAsyncComponent(() => import('./Relations.vue'))
  )
  app.component(
    'RevEditor',
    defineAsyncComponent(() => import('./Editor.vue'))
  )
  app.component(
    'RevRendererWord',
    defineAsyncComponent(() => import('./RendererWord.vue'))
  )
  app.component(
    'RevRendererXML',
    defineAsyncComponent(() => import('./RendererXML.vue'))
  )
  app.component(
    'RevGenerator',
    defineAsyncComponent(() => import('./Generator.vue'))
  )
  app.component(
    'RevDrawPolygon',
    defineAsyncComponent(() => import('./DrawPolygon.vue'))
  )
  app.component(
    'RevEcharts',
    defineAsyncComponent(() => import('./Echarts.vue'))
  )
}
